import request from '@/utils/request';

import test from "./test";
import chargeOrder from "./chargeOrder";
import roleGroup from "./roleGroup";
import manager from "./manager";
import managerLoginHistory from "./managerLoginHistory";
import dict from "./dict";
import globalRule from "./globalRule";
import helpDoc from "./helpDoc";
import sysAbout from "./sysAbout";
import sysFeedback from "./sysFeedback";
import stockInfo from "./stockInfo";
import stockInfoDragonLayer from "./stockInfoDragonLayer";
import stockPool from "./stockPool";
import transaction from "./transaction";
import vipPrice from "./vipPrice";
import marketStatus from "./marketStatus";
import stockCollect from "./stockCollect";
import {getToken} from '@/utils/auth'
import {randomString} from '@/utils'
import {encryptParams} from "@/utils/aesUtils";
import pubsub from 'pubsub-js'

const getLocalToken = () => {
  return window.tokenEncrypt ? encryptParams(getToken()) : getToken();
}

export default {
  test,
  chargeOrder,
  roleGroup,
  manager,
  managerLoginHistory,
  globalRule,
  dict,
  helpDoc,
  sysAbout,
  sysFeedback,
  stockInfo,
  stockInfoDragonLayer,
  stockPool,
  transaction,
  vipPrice,
  marketStatus,
  stockCollect,
  getLocalToken,
  constant: {
    all() {
      return request({
        url: '/api/constant/all',
        method: 'POST'
      })
    }
  }
}
